##Information on 4 datasets

#############################====================================================================
#### Table 2
#############################====================================================================
rm(list=ls())

## name of data sets
namebank  = c("Eisner", "Bordbar", "Taware", "Al-Mutawa")

# load data
load("Eisner/d_uri.RData")
load("Bordbar/d23.RData")
load("Taware/d760.RData")
load("Al-Mutawa/d541.RData")

cases =  c( paste("cachexic", sum(d_uri[,64]), "control", 77- sum(d_uri[,64]), sep = " "), paste("lps", sum(d23[,52]), "control", 12- sum(d23[,52]), sep = " ") , 
    paste("hnc", 92- sum(d760[,48]), "control", sum(d760[,48]), sep = " "), paste("hp", 44- sum(d541[,262]), "control", sum(d541[,262]), sep = " ") )
 
## Table 2
cbind(namebank, cases)
 


#############################====================================================================
#### Table 3
#############################====================================================================
##Information on pathway list
rm(list=ls())


## Eisner
load("Eisner/d_uri.RData")
load("Eisner/pathwaydatabase_uri/wikipath_metab_uri.RData")
load("Eisner/pathwaydatabase_uri/keggpath_metab_uri.RData")
load("Eisner/pathwaydatabase_uri/biocycpath_metab_uri.RData")
load("Eisner/pathwaydatabase_uri/smpdbhmdbpath_metab_uri.RData")

mls = ncol(d_uri)-1

allpathway = c(wikipath_uniq,keggpath_metab, biocycpath_metab, smpdbhmdbpath_metab, as.list(colnames(d_uri)[1:mls]) )
allpathwayuri = allpathway[!duplicated(allpathway) ]
save(allpathwayuri, file="Eisner/allpathwayuri.RData")


eisner_path = round(c(nrow(d_uri), mls, length(allpathwayuri) , mean(sapply(allpathwayuri,length)),  max(sapply(allpathwayuri,length)))  )


## Bordbar
load("Bordbar/d23.RData")
load("Bordbar/pathwaydatabase23/wikipath_metab_23.RData")
load("Bordbar/pathwaydatabase23/keggpath_metab_23.RData")
load("Bordbar/pathwaydatabase23/biocycpath_metab_23.RData")
load("Bordbar/pathwaydatabase23/smpdbhmdbpath_metab_23.RData")

mls = ncol(d23)-1

allpathway = c(wikipath_uniq,keggpath_metab, biocycpath_metab, smpdbhmdbpath_metab, as.list(colnames(d23)[1:mls]) )
allpathway23 = allpathway[!duplicated(allpathway) ]
save(allpathway23, file="Bordbar/allpathway23.RData")


bordbar_path = round( c(nrow(d23), mls, length(allpathway23) , mean(sapply(allpathway23,length)),  max(sapply(allpathway23,length))) )


## Taware
load("Taware/d760.RData")
load("Taware/pathwaydatabase760/wikipath_metab_760.RData")
load("Taware/pathwaydatabase760/keggpath_metab_760.RData")
load("Taware/pathwaydatabase760/biocycpath_metab_760.RData")
load("Taware/pathwaydatabase760/smpdbhmdbpath_metab_760.RData")

mls = ncol(d760)-1

allpathway = c(wikipath_uniq,keggpath_metab, biocycpath_metab, smpdbhmdbpath_metab, as.list(colnames(d760)[1:mls]) )
allpathway760 = allpathway[!duplicated(allpathway) ]
save(allpathway760, file="Taware/allpathway760.RData")


taware_path = round( c(nrow(d760), mls, length(allpathway760) , mean(sapply(allpathway760,length)),  max(sapply(allpathway760,length))) )


## Al-Mutawa
load("Al-Mutawa/d541.RData")
load("Al-Mutawa/pathwaydatabase541/wikipath_metab_541.RData")
load("Al-Mutawa/pathwaydatabase541/keggpath_metab_541.RData")
load("Al-Mutawa/pathwaydatabase541/biocycpath_metab_541.RData")
load("Al-Mutawa/pathwaydatabase541/smpdbhmdbpath_metab_541.RData")
 

mls = ncol(d541)-1
allpathway = c(wikipath_uniq,keggpath_metab, biocycpath_metab, smpdbhmdbpath_metab, as.list(colnames(d541)[1:mls]) )
allpathway541 = allpathway[!duplicated(allpathway) ]
length(allpathway541)
save(allpathway541, file="Al-Mutawa/allpathway541.RData")
 

almutawa_path = round(c(nrow(d541), mls, length(allpathway541) , mean(sapply(allpathway541,length)),  max(sapply(allpathway541,length))) )

rbind(eisner_path, bordbar_path,taware_path, almutawa_path)

